package ViewPackage;

import java.awt.Color;
import java.awt.Graphics;

import delta.Field;
import delta.IFieldable;

public class FieldView {
	private Field observedField;
	private Color color;
	private GameView view;
	private int xpos;
	private int ypos;
	
	//Ezek a class diagramon nem szerepeltek
	private int width;
	private int height;
	
	public FieldView(GameView view,Field field,int x,int y, Color color){
		this.view=view;
		this.observedField=field;
		this.xpos=x;
		this.ypos=y;
		this.color=color;
		this.height=0;
		this.width=0;
		
	}
	public int getXPos(){
		return xpos;
	}
	public int getYPos(){
		return ypos;
	}
	public void setXPos(int xPos){
		xpos=xPos;
	}
	public void setYPos(int yPos){
		ypos=yPos;
	}
	public int getWidth(){
		return width;
	}
	public int getHeight(){
		return height;
	}
	public void setWidth(int width){
		this.width=width;
	}
	
	public void setHeight(int height){
		this.height=height;
	}
	/*
	 * A GameView -rol letorli a FieldView -t
	 */
	public void remove(){
		
	}
	
	
	//Kirajzolja a mezot
	public void draw(Graphics g){
		g.setColor(color);
		g.fillRect(xpos, ypos, width, height);
		g.setColor(Color.black);
		g.drawRect(xpos-1, ypos-1, width, height);
		
		//tavolsag kiirasa
//		Integer distance=observedField.getDistance();
//		String str=distance.toString();
//		
//		g.drawString(str, xpos+10, ypos+10);
	}
	/*Visszater a megfigyelt mezovel
	 * nem volt benne az osztalydiagrammban
	 */
	public Field getObservedField(){
		return observedField;
	}
}
